package up.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Main extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //TextView tv = new TextView(this);
        //tv.setText("FALA MANO !");
        //setContentView(tv);
        
        Button btnAux = (Button)findViewById(R.id.btnChamarView);
        btnAux.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				setContentView(R.layout.view);
			}
		});
        	
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
    	MenuInflater inflater = getMenuInflater();
    	inflater.inflate(R.menu.mainmenu, menu);
    	MenuItem item = menu.findItem(R.id.item1);
    	item.setOnMenuItemClickListener(new OnMenuItemClickListener()
    	{
    		public boolean onMenuItemClick(MenuItem item)
    		{
    			Intent it = new Intent (Main.this, AnotherActivity.class);
    			startActivity(it);
    			return true;
    		}
    	});
    	return true;
    }
    
   @Override
    public void onRestart() {
    	// TODO Auto-generated method stub
    	//
    	Log.d("HelloWorld", "onRestart called");
    	super.onRestart();
    }
    
    @Override
    public void onResume() {
    	// TODO Auto-generated method stub
    	//
    	Log.d("AloMundp", "onResume called");
    	super.onResume();
    }
    
    @Override
    public void onStart() {
    	// TODO Auto-generated method stub
    	//
    	Log.d("AloMundp", "onStart called");
    	super.onStart();
    }
    
    @Override
    public void onStop() {
    	// TODO Auto-generated method stub
    	//super.onStop();
    	Log.d("AloMundp", "onStop called");
    	super.onStop();
    }
    
    
    @Override
    public void onDestroy() {
    	// TODO Auto-generated method stub
    	//super.onDestroy();
    	Log.d("AloMundp", "onDestroy called");
    	super.onDestroy();
    }
    
    @Override
    public void onPause() {
    	// TODO Auto-generated method stub
    	//super.onPause();
    	Log.d("AloMundp", "onPause called");
    	super.onPause();
    }
    
    
    
    
}